//package com.nyz.huawei.model;
//
//import com.huaweicloud.sdk.core.auth.BasicCredentials;
//import com.huaweicloud.sdk.campusgo.v2.model.TaskInputData;
//import com.huaweicloud.sdk.core.auth.ICredential;
//import com.huaweicloud.sdk.core.exception.ConnectionException;
//import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
//import com.huaweicloud.sdk.core.exception.ServiceResponseException;
//import com.huaweicloud.sdk.vod.v1.VodClient;
//import com.huaweicloud.sdk.vod.v1.model.CreateAssetByFileUploadReq;
//import com.huaweicloud.sdk.vod.v1.model.CreateAssetByFileUploadRequest;
//import com.huaweicloud.sdk.vod.v1.model.CreateAssetByFileUploadResponse;
//import com.huaweicloud.sdk.vod.v1.region.VodRegion;
//import org.springframework.stereotype.Service;
//
//import java.io.IOException;
//
//
//public class UploadAssetRsp {
//    /**
//     * 创建媒资：上传方式
//     * @param args
//     */
//    public static void main(String[] args) {
//
//        String ak = System.getenv("CLOUD_SDK_AK");
//        String sk = System.getenv("CLOUD_SDK_SK");
//
//        ICredential auth = new BasicCredentials()
//                .withAk(ak)
//                .withSk(sk);
//
//        VodClient client = VodClient.newBuilder()
//                .withCredential(auth)
//                .withRegion(VodRegion.valueOf("ap-southeast-2"))
//                .build();
//        CreateAssetByFileUploadRequest request = new CreateAssetByFileUploadRequest();
//        CreateAssetByFileUploadReq body = new CreateAssetByFileUploadReq();
//        request.withBody(body);
//        try {
//            CreateAssetByFileUploadResponse response = client.createAssetByFileUpload(request);
//            System.out.println(response.toString());
//        } catch (ConnectionException e) {
//            e.printStackTrace();
//        } catch (RequestTimeoutException e) {
//            e.printStackTrace();
//        } catch (ServiceResponseException e) {
//            e.printStackTrace();
//            System.out.println(e.getHttpStatusCode());
//            System.out.println(e.getRequestId());
//            System.out.println(e.getErrorCode());
//            System.out.println(e.getErrorMsg());
//        }
//    }
//    /**
//     * 获取响应码
//     * @return
//     * @throws IOException
//     */
//    public int getHttpCode() throws Exception {
//
///*        try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
//            HttpGet httpGet = new HttpGet(URL);
//            HttpResponse response = httpClient.execute(httpGet);
//            return response.getStatusLine().getStatusCode();
//        }*/
//        return 200;
//    }
//    public TaskInputData getTarget() {
//
//        return null ;
//    }
//    public String getAssetId() {
//
//        return "" ;
//    }
//    public String getBucket() {
//         String bucket = "qiao-test";
//       return bucket;
//    }
//
//}
